package com.example.controller.shenhe;

import com.example.pojo.CourseRecord;
import com.example.service.shenhe.Shcourseservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @ClassName: ***
 * @Description: ***
 * @author: ***
 * @date: 2022/12/9 13:39
 */
@Controller
@CrossOrigin
@RequestMapping("shcoursr")
public class Shcoursecontroller {
    @Autowired
    private Shcourseservice shcourseservice;

    /**
    * @Author: zdp
    * @Description: 未审核课程
    * @DateTime: 13:41 2022/12/9
    */
    @ResponseBody
    @PostMapping("/call")
    public List call(){
        return shcourseservice.call();
    }

    /**
    * @Author: zdp
    * @Description: 查询课程分类
    * @DateTime: 15:44 2022/12/12
    * @Params:
    * @Return
    */
    @ResponseBody
    @PostMapping("/courseclass")
    public List courseclass(){
        return shcourseservice.courseclass();
    }
    /**
    * @Author: zdp
    * @Description: 模糊查
    * @DateTime: 10:53 2022/12/13
    * @Params:
    * @Return
    */
    @ResponseBody
    @PostMapping("/cha")
    public List check(String courseName, String name, int courseNprice){
        return shcourseservice.check(courseName,name,courseNprice);
    }

    /**
    * @Author: zdp
    * @Description: 审核课程，修改课程审核状态、添加审核记录表
    * @DateTime: 11:58 2022/12/16
    * @Params:
    * @Return
    */
    @ResponseBody
    @RequestMapping("/shenhe")
    public int shenhe(CourseRecord courseRecord){
        System.out.println(courseRecord);
        int shenhe = shcourseservice.shenhe(courseRecord);
        return shenhe;
    }
}
